package behavior.Memento;

/**
 * Created by LYJ on 2016/10/21.
 * 原发器
 */
public class Originator  {
    private int bloodValue;//血条
    private int magicValue;//法力值

    public Originator(int bloodValue, int magicValue) {
        this.bloodValue = bloodValue;
        this.magicValue = magicValue;
    }

    public int getBloodValue() {
        return bloodValue;
    }

    public void setBloodValue(int bloodValue) {
        this.bloodValue = bloodValue;
    }

    public int getMagicValue() {
        return magicValue;
    }

    public void setMagicValue(int magicValue) {
        this.magicValue = magicValue;
    }
    public void display(){
        System.out.println("血量："+bloodValue+"   法力："+magicValue);
    }
    public Memento saveMemento(){
        return new Memento(bloodValue,magicValue);
    }
    public void readMemento(Memento memento){
        this.bloodValue=memento.getBloodValue();
        this.magicValue=memento.getBloodValue();
    }

}
